package com.gitee.l0km.aocache;

import static com.gitee.l0km.aocache.SimpleLog.stackTraceOf;
class AocacheLoggerDefaultImpl implements AocacheLogger {
	@Override
	public String logString(String format, Object... args) {
		return SimpleLog.logString(format, args);
	}

	@Override
	public void log(String format, Object... args) {
		SimpleLog.log(System.out,3, format, args);
	}

	@Override
	public void log(String msg, Throwable e) {
		SimpleLog.log(System.out,3, "{}\n{}",msg,stackTraceOf(e));
	}

	@Override
	public void log(Throwable e) {
		SimpleLog.log(System.out,3,"{}",stackTraceOf(e));
	}

	@Override
	public void log(boolean output, String format, Object... args) {
		if(output){
			SimpleLog.log(System.out,3,format,args);
		}
	}
}
